/*
*	Project: Aethon
*
*	File: Control.h
*
*	Author: Jonathan Hersack
*
*	Date: 2/15/2009
*
*   Purpose: The Control handles the keyboard/mouse input for the 
*   user-to-model interaction
*/

#ifndef CONTROL_H_
#define CONTROL_H_

#include <iostream>
#include <GL/glut.h>
#include "../include/Model.h"
#include "../include/ModelPart.h"
#include "../include/vector3f.h"
#include <GL/glut.h>
#include <math.h>

using namespace std;

//vector3f tempvect;
const float PixelDegreeFactor = 15.0;
static vector3f diffVel;//change in velocity, added to modelPtr's velcotiy to change it
//v.[0] refers to forward acceleration. v.[1] is strafing v[2] is up/down for jump
static vector3f diffDir;//change in direction, caused by mouse motion
static int lastX = 320;// initial center values
static int lastY = 240; 
static int DeadZone = 5;
static int InvertedLook = 1;//should be 1 to invert vertical look -1 for non-inverted
static int InvertedHorizLook = -1;
//unit cirle points

 
class Control{

    bool isActive;  
	Model* modelPtr;

	public:
	Control(){}
	
	static void keyboardHandle(unsigned char key, int x, int y);
	static void mouseHandle(int x, int y);
	void updateVelocity();
	void updateDirection();
	vector3f calcPoints(vector3f angles);
	vector3f normalizeVector(vector3f vect);
	//gets and sets-----------------------------------------------------------
   	
	void setIsActive(bool active)
	{
         isActive = active;
    }//end setiswire
    
	bool getIsActive()
	{
         return isActive;
    }//end getisactive
    
	void setModelPtr(Model* ptr)
	{
         modelPtr = ptr;
    }//end setiswire
    
	bool getModelPtr()
	{
         return modelPtr;
    }//end getisactive
    	
	void setDiffVel(vector3f vel)
	{
         diffVel = vel;
    }//end setDiffVel
    
	vector3f getDiffVel()
	{
         return diffVel;
    }//end getdiffVel
	
	void setDiffDir(vector3f dir)
	{
         diffDir = dir;
    }//end setDiffDir
    
	vector3f getDiffDir()
	{
         return diffDir;
    }//end getdiffDir
	
};//end class

#endif //CONTROL_H_

